﻿using System;
using System.Collections.Generic;
using Utility = Microsoft.Sample.Outlook.Utility;
using MSOutlook = Microsoft.Office.Interop.Outlook;


namespace Microsoft.Sample.Outlook.CRMIntegration {
    
    
    public partial class PIMDataSet {
        partial class ContactsDataTable
        {
        }
        
        //Set OutlookID for show PersonalFolderToday user control
        [Utility.OutlookFolderSync("Name")]
        partial class AccountsRow : Utility.IOutlookSyncItem
        {
            string Utility.IOutlookSyncItem.EntryID
            {
                get { return this.OutlookID; }
                set { this.OutlookID = value; }
            }
        }

        [Utility.OutlookItemSync(MSOutlook.OlItemType.olAppointmentItem)]
        [Utility.OutlookCustomSyncInfo("GetSyncInfo")]
        partial class AppointmentsRow : Utility.IOutlookSyncItem
        {
            string Utility.IOutlookSyncItem.EntryID
            {
                get { return this.OutlookID; }
                set { this.OutlookID = value; }
            }

            public static IDictionary<string, Utility.OutlookFieldSyncAttribute> GetSyncInfo()
            {
                Dictionary<string, Utility.OutlookFieldSyncAttribute> syncInfo = new Dictionary<string, Utility.OutlookFieldSyncAttribute>();
                syncInfo.Add("Subject", new Utility.OutlookFieldSyncAttribute("Subject"));
                syncInfo.Add("Location", new Utility.OutlookFieldSyncAttribute("Location"));
                syncInfo.Add("Duration", new Utility.OutlookFieldSyncAttribute("Duration"));
                syncInfo.Add("Start", new Utility.OutlookFieldSyncAttribute("Start"));
                syncInfo.Add("End", new Utility.OutlookFieldSyncAttribute("End"));
                //syncInfo.Add("IsalldayeventNullCheck", new Utility.OutlookFieldSyncAttribute("Start"));
                syncInfo.Add("Comments", new Utility.OutlookFieldSyncAttribute("Body"));
                

                return syncInfo;
            }

            public Int32? DurationNullCheck
            {
                get
                {
                    if (this.IsDurationNull())
                        return null;

                    return this.Duration;
                }
            }
            public bool? IsalldayeventNullCheck
            {
                get
                {
                    if (this.IsEndNull())
                        return null;

                    return this.Isalldayevent;
                }
            }
            public DateTime? StartDateNullCheck
            {
                get
                {
                    if (this.IsStartNull())
                        return null;

                    return this.Start;
                }
            }
            public DateTime? EndDateNullCheck
            {
                get
                {
                    if (this.IsEndNull())
                        return null;

                    return this.End;
                }
            }


        }
	
        [Utility.OutlookItemSync(MSOutlook.OlItemType.olContactItem)]
        [Utility.OutlookCustomSyncInfo("GetSyncInfo")]
        partial class ContactsRow : Utility.IOutlookSyncItem
        {
            string Utility.IOutlookSyncItem.EntryID
            {
                get { return this.OutlookID; }
                set { this.OutlookID = value; }
            }

            public static IDictionary<string, Utility.OutlookFieldSyncAttribute> GetSyncInfo()
            {
                Dictionary<string, Utility.OutlookFieldSyncAttribute> syncInfo = new Dictionary<string, Utility.OutlookFieldSyncAttribute>();
                syncInfo.Add("FirstName", new Utility.OutlookFieldSyncAttribute("FirstName"));
                syncInfo.Add("LastName", new Utility.OutlookFieldSyncAttribute("LastName"));
                syncInfo.Add("NickName", new Utility.OutlookFieldSyncAttribute("Nickname"));
                syncInfo.Add("Department", new Utility.OutlookFieldSyncAttribute("Department"));
                syncInfo.Add("JobTitle", new Utility.OutlookFieldSyncAttribute("JobTitle"));
                syncInfo.Add("Email", new Utility.OutlookFieldSyncAttribute("Email1Address"));
                syncInfo.Add("WebPage", new Utility.OutlookFieldSyncAttribute("BusinessHomePage"));
                syncInfo.Add("Address", new Utility.OutlookFieldSyncAttribute("BusinessAddressStreet"));
                syncInfo.Add("City", new Utility.OutlookFieldSyncAttribute("BusinessAddressCity"));
                syncInfo.Add("StateRegion", new Utility.OutlookFieldSyncAttribute("BusinessAddressState"));
                syncInfo.Add("PostalCode", new Utility.OutlookFieldSyncAttribute("BusinessAddressPostalCode"));
                syncInfo.Add("Country", new Utility.OutlookFieldSyncAttribute("BusinessAddressCountry"));
                syncInfo.Add("OfficePhone", new Utility.OutlookFieldSyncAttribute("BusinessTelephoneNumber"));
                syncInfo.Add("OfficeFax", new Utility.OutlookFieldSyncAttribute("BusinessFaxNumber"));
                syncInfo.Add("MobilePhone", new Utility.OutlookFieldSyncAttribute("MobileTelephoneNumber"));
                syncInfo.Add("Comments", new Utility.OutlookFieldSyncAttribute("Body"));

                return syncInfo;
            }
        }
 
    }
}
